import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import set from '@dfeidao/atom-mobile/local/set';
import show_sheet from '@dfeidao/atom-mobile/msgbox/action-sheet';
import render from '@dfeidao/atom-mobile/render/render';
import a010 from './a010';

export default async function a002(fd: IFeidaoAiMobile) {
	// 请选择假期类型
	const options = [{ text: "事假" }, { text: "病假" }, { text: "婚假" }, { text: "产检假" }];
	const res = await show_sheet({
		options
	});
	const selects = options[res] as { text: string };
	render(fd, { res: selects.text });
	let selected = "";
	if (selects.text === "事假") {
		selected = "0";
	}
	if (selects.text === "病假") {
		selected = "1";
	}
	if (selects.text === "婚假") {
		selected = "2";
	}
	if (selects.text === "产检假") {
		selected = "3";
	}
	set(fd, 'leave_type', selected);
	a010(fd);
	// console.log(selects);
}
